@echo Off
Echo ******************************************************
echo *                                                    *
echo *                AddOn Installer v1.1                *
echo *                     for NHL09                      *
echo *                                                    *
echo ******************************************************
echo *              Script by: Sudden Death               *
echo ******************************************************
echo *                                                    *
echo *         visit: http://www.wasserlasser.de          *
echo *                                                    *
echo ******************************************************
echo.

cd c:\programme\ea sports\nhl 09


:JERSEYS
if not exist letters*.fsh if not exist num*.fsh if not exist uni*.fsh GOTO PREVIEW-JERSEYS
FOR /F "tokens=1,2 delims=." %%i in ('dir letters_?????.fsh /b') DO ImpBIG /i gamedata\jerseys.viv %%i.fsh %%i.fsh /c
FOR /F "tokens=1,2 delims=." %%i in ('dir num?????.fsh /b') DO ImpBIG /i gamedata\jerseys.viv %%i.fsh %%i.fsh /c
FOR /F "tokens=1,2 delims=." %%i in ('dir uni?????.fsh /b') DO ImpBIG /i gamedata\jerseys.viv %%i.fsh %%i.fsh /c
ImpBIG /r gamedata\jerseys.viv
genbhnhl gamedata\jerseys.viv
ImpBIG /i preload\czone.viv jerseys.bh gamedata\jerseys.bh /c
ImpBIG /i preload\gmisc.viv jerseys.bh gamedata\jerseys.bh /c
ImpBIG /r preload\czone.viv
ImpBIG /r preload\gmisc.viv
del letters*.fsh num*.fsh uni*.fsh

:PREVIEW-JERSEYS
if not exist JERS*.big GOTO ICES
FOR /F "tokens=1,2 delims=." %%i in ('dir JERS_??????.big /b') DO ImpBIG /i fe\jerapt.viv %%i.big %%i.big /c
ImpBIG /r fe\jerapt.viv
genbhnhl fe\jerapt.viv
ImpBIG /i preload\fapt.viv jerapt.bh fe\jerapt.bh /c
ImpBIG /r preload\fapt.viv
del JERS*.big

:ICES
if not exist ICE*.fsh if not exist crowd*.fsh if not exist puck*.fsh GOTO GOALIES
FOR /F "tokens=1,2 delims=." %%i in ('dir ICE_???.fsh /b') DO ImpBIG /i gamedata\IceTxtrs.big %%i.fsh %%i.fsh /c 
FOR /F "tokens=1,2 delims=." %%i in ('dir crowd???.fsh /b') DO ImpBIG /i gamedata\IceTxtrs.big %%i.fsh %%i.fsh /c 
FOR /F "tokens=1,2 delims=." %%i in ('dir puck_???.fsh /b') DO ImpBIG /i gamedata\IceTxtrs.big %%i.fsh %%i.fsh /c 
ImpBIG /r gamedata\IceTxtrs.big
genbhnhl gamedata\IceTxtrs.big
ImpBIG /i preload\gmisc.viv IceTxtrs.bh gamedata\IceTxtrs.bh /c
ImpBIG /r preload\gmisc.viv
del ICE*.fsh crowd*.fsh puck_*.fsh

:GOALIES
if not exist goalies*.fsh GOTO LOGOS
FOR /F "tokens=1,2 delims=." %%i in ('dir goalies_helm_?????.fsh /b') DO ImpBIG /i gamedata\goalies.viv %%i.fsh %%i.fsh /c 
FOR /F "tokens=1,2 delims=." %%i in ('dir goalies_pads_?????.fsh /b') DO ImpBIG /i gamedata\goalies.viv %%i.fsh %%i.fsh /c 
FOR /F "tokens=1,2 delims=." %%i in ('dir goalies_stick_?????.fsh /b') DO ImpBIG /i gamedata\goalies.viv %%i.fsh %%i.fsh /c 
ImpBIG /r gamedata\goalies.viv
genbhnhl gamedata\goalies.viv
genbhnhl preload\czonegoalies.viv
ImpBIG /i preload\czone.viv goalies.bh gamedata\goalies.bh
ImpBIG /i preload\czone.viv czonegoalies.bh preload\czonegoalies.bh /c
ImpBIG /i preload\gmisc.viv goalies.bh gamedata\goalies.bh /c
ImpBIG /r preload\czone.viv
ImpBIG /r preload\gmisc.viv
del goalies*.fsh

:LOGOS
if not exist LOGO_*.big GOTO FACEPACKS
FOR /F "tokens=1,2 delims=." %%i in ('dir LOGO_LRG_??????.big /b') DO ImpBIG /i fe\tlogoapt.viv %%i.big %%i.big /c
FOR /F "tokens=1,2 delims=." %%i in ('dir LOGO_MED_??????.big /b') DO ImpBIG /i fe\tlogoapt.viv %%i.big %%i.big /c
ImpBIG /r fe\tlogoapt.viv
genbhnhl fe\tlogoapt.viv
ImpBIG /i preload\gmisc.viv tlogoapt.bh fe\tlogoapt.bh /c
ImpBIG /i preload\fapt.viv tlogoapt.bh fe\tlogoapt.bh /c
ImpBIG /r preload\gmisc.viv
ImpBIG /r preload\fapt.viv
del LOGO_*.big

:FACEPACKS
if not exist *.big GOTO CYBERFACES
FOR /F "tokens=1,2 delims=." %%i in ('dir ?????.big /b') DO ImpBIG /i fe\portapt.viv %%i.big %%i.big /c
ImpBIG /r fe\portapt.viv
genbhnhl fe\portapt.viv
ImpBIG /i preload\gmisc.viv portapt.bh fe\portapt.bh /c
ImpBIG /i preload\fapt.viv portapt.bh fe\portapt.bh /c
ImpBIG /r preload\gmisc.viv
ImpBIG /r preload\fapt.viv
del *.big

:CYBERFACES
if not exist face*.* GOTO ROSTER
FOR /F "tokens=1,2 delims=." %%i in ('dir FACE?????.fsh /b') DO ImpBIG /i gamedata\faces.viv %%i.fsh %%i.fsh /c 
FOR /F "tokens=1,2 delims=." %%i in ('dir FACE?????.ebo /b') DO ImpBIG /i gamedata\faces.viv %%i.ebo %%i.ebo /c 
ImpBIG /r gamedata\faces.viv
genbhnhl gamedata\faces.viv
ImpBIG /i preload\czone.viv faces.bh gamedata\faces.bh /c
ImpBIG /i preload\gmisc.viv faces.bh gamedata\faces.bh /c
ImpBIG /r preload\czone.viv
ImpBIG /r preload\gmisc.viv
del FACE*.ebo FACE*.fsh

:ROSTER
if not exist db.viv if not exist exhibition.* if not exist local.viv GOTO PLAYERS
FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal') DO SET Pfad=%%B
copy exhibition.exh "%Pfad%\NHL08\*.*"
copy exhibition.exha.tdb "%Pfad%\NHL08\*.*"
copy db.viv db\*.*
copy local.viv fe\*.*
genbhnhl db\db.viv
ImpBIG /i preload\fapt.viv db.bh db\db.bh /c
ImpBIG /i preload\fmisc.viv local.bh fe\local.bh /c
ImpBIG /r preload\fapt.viv
ImpBIG /r preload\fmisc.viv
del db.viv exhibition.* local.viv

:PLAYERS
if not exist sticks.fsh if not exist skates.fsh GOTO EXIT
ImpBIG /i gamedata\players.viv sticks.fsh sticks.fsh /c
ImpBIG /i gamedata\players.viv skates.fsh skates.fsh /c
ImpBIG /r gamedata\players.viv
genbhnhl gamedata\players.viv
ImpBIG /i preload\gmisc.viv players.bh gamedata\players.bh /c
ImpBIG /r preload\gmisc.viv
del sticks.fsh skates.fsh

:EXIT
exit